<template>
  <van-nav-bar 
    left-arrow
    :right-text="rightText"
    :title="title"
    fixed
    @click-left="onClickLeft"
    @click-right="$emit('child-event','payload')" />
</template>
<script setup lang="ts">
import { useRouter } from 'vue-router';
const router = useRouter()
const props=defineProps<{
  rightText?:string
  title?:string
}>()
const onClickLeft = () => {
  if (history.state?.back) {
    router.back()
  } else {
    router.push('/')
  }
}
// const onClickRight = () => {
//   // router.push('/register')

// }
</script>
<style lang="scss" scoped>
:deep() {
  .van-nav-bar {
    &__arrow {
      color: var(--cp-text1) !important;
      font-size: 18px;
    }

    &__text {
      font-size: 15px;
    }
  }
}
</style>